﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using StructureMap;
namespace myFinance.Web.Controllers {
    public class StructureMapControllerFactory : DefaultControllerFactory {

        protected override IController GetControllerInstance(Type controllerType) {
            try {
                return ObjectFactory.GetInstance(controllerType) as Controller;

            }
            catch (StructureMapException) {
                System.Diagnostics.Debug.WriteLine(ObjectFactory.WhatDoIHave());
                throw;
            }
        }
    }
}
